package com.roads.web.controller.common;

import com.roads.common.core.domain.AjaxResult;
import com.roads.system.domain.DictNation;
import com.roads.system.domain.DictProvince;
import com.roads.system.service.IDictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName DictController
 * @Description 字典controller
 * @Author nhp
 * @Date 2022/10/27 0024 13:24
 * @Version 1.0.0
 **/
@RestController
@RequestMapping("/dict")
public class DictController {

    @Autowired
    private IDictService dictService;

    /**
     * 获取省集合
     */
    @GetMapping(value = "/getProvinceList")
    public AjaxResult getProvinceList() {
        List<DictProvince> provinceList = dictService.getProvinceList();
        return AjaxResult.success(provinceList);
    }

    /**
     * 获取民族集合
     */
    @GetMapping(value = "/getNationList")
    public AjaxResult getNationList() {
        List<DictNation> nationList = dictService.getNationList();
        return AjaxResult.success(nationList);
    }

}
